package org.zhs.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.zhs.dao.EmployeeDao;
import org.zhs.pojo.Employee;

import java.util.Collection;

@Controller
public class EmployeesController {
    @Autowired
    EmployeeDao empDao;
    @RequestMapping("/emps")
    public String emps(Model m){
        Collection<Employee> employees = empDao.getEmployees();
        m.addAttribute("emps",employees);
        return "/emp/list";
    }
}
